/*
 * Copyright 2014 JootMir Project
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * Support: http://www.jootmir.org
 */
package org.jootmir.client.game;

import javax.swing.JOptionPane;

import org.jootmir.client.core.ApplicationListener;

import static org.jootmir.client.game.map.MapHolder.*;

/**
 * 测试地图绘制
 * 
 * @author ShawRyan
 */
public class MapTest implements ApplicationListener {

	
	public void create() {
		// 使人物进入“比奇”
		mhEnterAsyn("0", (short) 333, (short) 330);
		//mhEnterAsyn("0", (short) 106, (short) 315);
	}

	public void render() {
		// 绘制地图
		mhDraw();
	}

	public void dispose() {

	}

	public boolean isRequestExit() {
		return false;
	}

	public boolean acceptCloseEvent() {
		// FIXME 非awt下不是modal
		int res = JOptionPane.showConfirmDialog(null, "确认退出？", "退出游戏",
				JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
		if (res == JOptionPane.YES_OPTION)
			return true;
		else if (res == JOptionPane.NO_OPTION)
			return false;
		return true;
	}

}